<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBancisTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bancis', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('班次名称');
            $table->integer('number')->comment('上下班次数')->nullable();
            $table->string('work_time')->comment('工作时间')->nullable();
            $table->boolean('clock')->comment('是否打卡 0:打卡 1:不打卡')->default(0);
            $table->integer('allowedLate')->comment('允许迟到时间')->nullable();
            $table->integer('seriousLate')->comment('严重迟到时间')->nullable();
            $table->integer('absenteeism')->comment('旷工迟到时间')->nullable();
            $table->softDeletes();
            $table->timestamps();
            $table->unique(['name','deleted_at']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('bancis');
    }
}
